<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>返回选定历法的信息</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.cal-from-jd.html">cal_from_jd</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.cal-to-jd.html">cal_to_jd</a></div>
 <div class="up"><a href="ref.calendar.html">Calendar 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.cal-info" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">cal_info</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.1.0, PHP 5)</p><p class="refpurpose"><span class="refname">cal_info</span> &mdash; <span class="dc-title">返回选定历法的信息</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.cal-info-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">array</span> <span class="methodname"><strong>cal_info</strong></span>
    ([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$calendar</code><span class="initializer"> = -1</span></span>
  ] )</div>

  <p class="para rdfs-comment">
   <span class="function"><strong>cal_info()</strong></span>返回选定 <em><code class="parameter">calendar</code></em>的作息。
  </p>
  <p class="para">
    历法信息以一个数组的形式返回，包含的元素有<em>历法名称</em>，<em>历法代码</em>，<em>月份</em>，<em>月份的缩写</em>和<em>单月的最多天数</em>。作为参数的<em><code class="parameter">calendar</code></em>历法名字可以有：
   <ul class="itemizedlist">
    <li class="listitem">
     <span class="simpara">
      0 or <strong><code>CAL_GREGORIAN</code></strong> - Gregorian Calendar
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      1 or <strong><code>CAL_JULIAN</code></strong> - Julian Calendar
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      2 or <strong><code>CAL_JEWISH</code></strong> - Jewish Calendar
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      3 or <strong><code>CAL_FRENCH</code></strong> - French Revolutionary Calendar
     </span>
    </li>
   </ul>
  </p>
  <p class="para">
   如果没有指定参数<em><code class="parameter">calendar</code></em>，所支持的所有历法将以数组形式返回。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.cal-info-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">calendar</code></em></dt>

     <dd>

      <p class="para">
        返回信息所指定的历法名称，如果没有指定历法，将返回所有历法。
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.cal-info-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.cal-info-changelog">
  <h3 class="title">更新日志</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>版本</th>
       <th>说明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>Since 5.0</td>
       <td>
        参数<em><code class="parameter">calendar</code></em>作为可选项，缺省时默认值为&quot;所有历法&quot;。 
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.cal-info-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2179">
    <p><strong>Example #1 <span class="function"><strong>cal_info()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$info&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">cal_info</span><span style="color: #007700">(</span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$info</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Array
(
    [months] =&gt; Array
        (
            [1] =&gt; January
            [2] =&gt; February
            [3] =&gt; March
            [4] =&gt; April
            [5] =&gt; May
            [6] =&gt; June
            [7] =&gt; July
            [8] =&gt; August
            [9] =&gt; September
            [10] =&gt; October
            [11] =&gt; November
            [12] =&gt; December
        )

    [abbrevmonths] =&gt; Array
        (
            [1] =&gt; Jan
            [2] =&gt; Feb
            [3] =&gt; Mar
            [4] =&gt; Apr
            [5] =&gt; May
            [6] =&gt; Jun
            [7] =&gt; Jul
            [8] =&gt; Aug
            [9] =&gt; Sep
            [10] =&gt; Oct
            [11] =&gt; Nov
            [12] =&gt; Dec
        )

    [maxdaysinmonth] =&gt; 31
    [calname] =&gt; Gregorian
    [calsymbol] =&gt; CAL_GREGORIAN
)
</pre></div>
    </div>
   </div>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.cal-from-jd.html">cal_from_jd</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.cal-to-jd.html">cal_to_jd</a></div>
 <div class="up"><a href="ref.calendar.html">Calendar 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
